<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>阿丁账号-登录</title>
    <link rel="stylesheet" href="../js/bootstrap-3.4.1-dist/css/bootstrap.css">
    <link rel="stylesheet" href="../css/flex-box.css">
    <link rel="stylesheet" href="../css/register.css">
    <link rel="stylesheet" href="../css/login.css">
    <script src="../plugins/element-ui/lib/index.js"></script>
    <link rel="stylesheet" href="../plugins/element-ui/lib/theme-chalk/index.css">
</head>

<body>
<div id="app">
<div class="header">
    <div class="head-center flex-col j-c"></div>
</div>
<div class="container">
    <div class="main">
        <div class="title flex-row j-c">
            <p>阿丁账号登录</p>
        </div>
        <div class="content flex-row j-c">
            <div class="left flex-col a-c">
                <div class="code">
                    <img src="../image/detail/Honor-code.png" alt="">
                </div>
                <span>扫码登录或注册，若已在手机或平板上登录阿丁帐号，可进入“设置”&gt;“阿丁帐号”&gt;“帐号中心”扫码登录。</span>
            </div>
            <!--登录表单-->
            <div class="right">
                <div class="country flex-row j-s-b">
                    <span>国家或地区</span>
                    <span>中国</span>
                </div>
                <div class="input-group flex-row" id="phone">
                    <div class="phone-area flex-row ">
                        <span id="area">中国 +86</span>
                        <span class="glyphicon glyphicon glyphicon-triangle-bottom"></span>
                    </div>
                    <input type="text" name="" id="input" class="form-control" value="" required="required"
                           pattern="" placeholder="请输入手机号" v-model="form.phone">

                </div>
                <div class="input-group" id="code">
                    <input type="text" name="" id="input" class="form-control" value="" required="required"
                           pattern="" placeholder="请输入密码" v-model="form.code">
                    <!--<span class="form-control-feedback" style="display:inline-block;width: 80px;">获取验证码</span>-->
                </div>
                <p style="margin-top:15px"><a href="">验证码登录</a></p>
                <button  class="btn btn-info"  @click="login()">登录</button>
                <div class="third-login flex-col a-c">
                    <span>三方账号登录</span>
                    <div class="third flex-row j-c">
                        <a href=""><img src="../image/index-img/微信.png" alt=""></a>
                    </div>
                </div>

            </div>
        </div>
    </div>
</div>
<div class="footer">
    <div class="foot flex-col a-c">
        <ul class="flex-row j-s-b">
            <li><a href="">阿丁帐号用户协议 </a></li><em class="foot_em">|</em>
            <li><a href="">关于阿丁帐号与隐私的声明</a></li><em class="foot_em">|</em>
            <li><a href="">常见问题</a></li><em class="foot_em">|</em>
            <li><a href="">Cookies</a></li>
        </ul>
        <p>版权所有 © 2021-2022 阿丁社区。保留一切权利</p>
    </div>
</div>
</div>
</body>
<script src="../js/vue.js"></script>
<script src="../plugins/axios.min.js"></script>
<script src="../js/request.js"></script>
<script src="../api/login.js"></script>
<script>
    new Vue({
        el:"#app",
        data(){
            return{
                form:{
                    phone:'',
                    code:''
                }
            }
        },
        methods:{
            /*登录*/
            async login(){
               const res=await loginApi(this.form)
                if (res.code===1){
                    //存入浏览器
                    localStorage.setItem('user',JSON.stringify(res.data))
                    window.location.href='/browser/index.html'
                }
                else {
                    console.log(11,res)
                }
            },

        }
    })

</script>

</html>